<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/mall-common :: common_head(~{::title},~{::link},~{::script})">
    <title>网上图书商城</title>
    <link rel="stylesheet" href="/styles/mall/index.css">
    <script src="/javascript/mall/index.js" type="text/javascript"></script>
</head>
<body>
<div th:replace="common/mall-common::mall-header"></div>
<div class="mall-body">
    <div id="homeBanner" class="carousel slide home-banner">
        <div class="carousel-indicators">
            <button type="button" data-bs-target="#homeBanner" data-bs-slide-to="0" class="active"
                    aria-current="true" aria-label="Slide 1"></button>
            <button type="button" data-bs-target="#homeBanner" data-bs-slide-to="1" aria-label="Slide 2"></button>
            <button type="button" data-bs-target="#homeBanner" data-bs-slide-to="2" aria-label="Slide 3"></button>
        </div>
        <div class="carousel-inner">
            <div class="carousel-item active">
                <img src="/images/1.jpg"
                     class="d-block w-100  h-100">
            </div>
            <div class="carousel-item">
                <img src="/images/2.jpg"
                     class="d-block w-100  h-100">
            </div>
            <div class="carousel-item">
                <img src="/images/3.jpg"
                     class="d-block w-100  h-100">
            </div>
        </div>
        <button class="carousel-control-prev" type="button" data-bs-target="#homeBanner" data-bs-slide="prev">
            <span class="carousel-control-prev-icon" aria-hidden="true"></span>
            <span class="visually-hidden">Previous</span>
        </button>
        <button class="carousel-control-next" type="button" data-bs-target="#homeBanner" data-bs-slide="next">
            <span class="carousel-control-next-icon" aria-hidden="true"></span>
            <span class="visually-hidden">Next</span>
        </button>
    </div>
    <div class="area-title">新开张的出版社</div>
    <div>
    <div class="shop-area">
        <a class="shop-item" th:each="publish:${publishList.list}" th:href="'/publish-index?id=' + ${publish.id}">
            <img th:src="${publish.logo}" class="shop-image" />
            <div th:text="${publish.name}" class="shop-name"></div>
        </a>

    </div>
    <div th:replace="common/mall-common::common_pager(${publishList})"></div>
    </div>

    <div class="area-title">新上架的图书</div>
    <div class="goods-area">
        <a class="goods-item" th:each="books:${booksList}"  th:href="${'/books-detail?id=' + books.id}">
           <img th:src="${books.getBooksSkuList().get(0).getBooksSkuImgList().get(0).getImage()}" class="goods-image"/>


            <div class="goods-info">
                <div class="goods-title-line">
                    <div th:text="${books.name}" class="goods-name"></div>
                   <div th:text="${books.getBooksSkuList().get(0).getCurrentPrice() + '元'}" class="goods-price"></div>

                </div>
                <div class="goods-place" th:text="'作者：' + ${books.author}"></div>
                <div class="belong-shop" th:text="'出版社：' + ${books.belongpublish.name}"></div>
                <div class="books-inventory" th:text="'库存：' + ${books.getBooksSkuList().get(0).inventory}"></div>

            </div>
        </a>
    </div>
</div>


<script type="text/javascript">
    $(function() {
        $("#header").load("../common/mall-header.html")
    })
</script>

<div th:replace="common/mall-common::mall-footer"></div>
</body>
</html>
